<!DOCTYPE html>
<html lang="zh-CN"><head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>首页 - 康雅国际物流</title>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, width=device-width">
    <link rel="stylesheet" type="text/css" href="{EW_DELIVERT_STATIC}css/style.css">
    <link rel="stylesheet" type="text/css" href="{EW_DELIVERT_STATIC}css/common.css">
    <link rel="stylesheet" type="text/css" href="{EW_DELIVERT_STATIC}css/style-new.css">
    <link rel="stylesheet" type="text/css" href="{EW_DELIVERT_STATIC}css/swiper.min.css">
    <link rel="stylesheet" type="text/css" href="{EW_DELIVERT_STATIC}css/ordercommon.css">
    <script src="{EW_DELIVERT_STATIC}js/jweixin-1.0.0.js"> </script>
    <script src="{EW_DELIVERT_STATIC}js/jquery.js"></script>
</head>

<body>
    <div id="page" class="_page">
        <div id="mainContent" class="content">
    <div class="w100">
        <div class="banner clearfix swiper-container swiper-container-horizontal swiper-container-3d swiper-container-coverflow" style="cursor: -webkit-grab; height: 30rem;">
            <div class="stage swiper-wrapper" style="transition-duration: 0ms; transform: translate3d(0.5px, 0, 0);height: 25rem;">
                <div class="swiper-slide swiper-slide-active" style="transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(0deg); z-index: 1; transition-duration: 0ms;">
                    <div class="box">
                        <div class="container clearfix">
                            <dl class="box_title">
                                <dt></dt>
                                <dd style="color:#187130">康雅国际物流</dd>
                            </dl>
                            <img id="comImg" class="hidden" alt="康雅国际物流" src="{EW_DELIVERT_STATIC}image/icon.jpg" style="display: inline;">
                            <dl class="box_input input_state mt20">
                                <dt id="waybillNumId" style="">运单号</dt>
                                <dd>
                                    <div id="waybillStyleId" class="">
                                        <input class="" type="text" id="waybillNoId" placeholder="输入物流运单号" value="" onkeydown="keyupDownFunction(this,event)">
                                    </div>
                                </dd>
                                <dd class="scan_icon1" style="display:none" onclick="clearContent();"><i></i></dd>
                                <dd class="scan_icon" onclick="checkScanQRCode();" style="display: none;"></dd>
                            </dl>
                            <a class="box_submit icon0910_4" id="wayqueryId" onclick="waybillNoQuery();">查询</a>
                        </div>
                    </div>
                    <div class="swiper-slide-shadow-left" style="opacity: 0; transition-duration: 0ms;"></div><div class="swiper-slide-shadow-right" style="opacity: 0; transition-duration: 0ms;"></div>
                </div>

            </div>
            <div class="swiper-pagination">
            </div>
        </div>
        <div class="order_success mt10 clearfix">
            <a><img class="tips" src="../attachment/{php echo $adv['img']}" width="640" height="140"></a>
        </div>

        <div class="footNav">
            <ul class="cmnMenu">
                <li class="itm">
                    <a href="" class="menuBtn noborder">
                        <span class="icon navMenuIcon_lxkf"></span>
                        <label class="txt">导航按钮</label>
                    </a>
                </li>
                <li class="itm">
                    <a href="" class="menuBtn">
                        <span class="icon navMenuIcon_lxkf"></span>
                        <label class="txt">导航按钮</label>
                    </a>
                </li>
                <li class="itm">
                    <a href="" class="menuBtn">
                        <span class="icon navMenuIcon_lxkf"></span>
                        <label class="txt">导航按钮</label>
                    </a>
                </li>
                <li class="itm">
                    <a href="" class="menuBtn">
                        <span class="icon navMenuIcon_gywm"></span>
                        <label class="txt">导航按钮</label>
                    </a>
                </li>
            </ul>
        </div>
        <div class="ftnav index">
            <div class="index_url2 clearfix">
                <ul class="clearfix index_url2 index_url2_4">
                    <li class="first"><a href="{php echo $this->createMobileUrl('contact')}" id="contact_mobile"><span class="index_url_icon1"></span><p>联系客服</p></a></li>
                    <li><a href="{php echo $this->createMobileUrl('price')}" id="zh_logistics"><span class="index_url_icon2"></span><p>报价查询</p></a></li>
                    <li><a href="{php echo $this->createMobileUrl('store')}" id="storge_service"><span class="index_url_icon4"></span><p>仓储服务</p></a></li>
                    <li><a href="{php echo $this->createMobileUrl('about')}" id="about_us"><span class="index_url_icon3"></span><p>关于我们</p></a></li>
                </ul>
            </div>
        </div>
    </div>

    <script type="text/javascript" src="{EW_DELIVERT_STATIC}js/swiper.min.js"></script>
    <script type="text/javascript">
        var flag = true;
        var tempWaybill;
        var portindex = 0;

        //粘贴运单号
        if ($("#waybillStyleId span")) {
            //$("#waybillNoId").val($("#waybillStyleId span").context());
            $("#waybillStyleId span").remove();
        }

        //初始化加载数据
        $(document).ready(function () {
            $("#waybillNoId").val("");
            $("#phoneId").val("");
            $("#code").val("");
        });
        //初始化导航菜单
        function initMenu() {

            $.ajax({
                type: "GET",
                dataType: "json",
                url: "/api/Menu/IndexMenu",
                success: function (json) {
                    if (json.status == "1") {

                        $("#contact_mobile").attr("href", json.contact.url);
                        $("#zh_logistics").attr("href", json.logistics.url);
                        $("#about_us").attr("href", json.aboutus.url);
                        $("#storge_service").attr("href", json.service.url);

                        $("#contact_mobile > p").text(json.contact.name);
                        $("#zh_logistics > p").text(json.logistics.name);
                        $("#about_us > p").text(json.aboutus.name);
                        $("#storge_service > p").text(json.service.name);

                    } else {
                        var mess = "";
                        if (date.message != null) {
                            mess = ",原因：" + date.message;
                        }
                        tipsDialog("加载底部菜单信息失败" + mess);
                        return;
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    tipsDialog("系统繁忙，请稍后再试");
                }
            });
        }

        //初始化样式
        function initStyle() {
            var waybillNo = $("#waybillNoId").val();
            var tokenList = $(".token");
            if (waybillNo != '' || tokenList.length > 0) {
                $(".scan_icon1").show();
                $("#waybillStyleId").attr("class", "search_input clearfix");
                $("#waybillNumId").attr("style", "display:none");
                $("#waybillNoId").attr("placeholder", "");
            } else {
                $(".scan_icon1").hide();
                $("#waybillStyleId").attr("class", "");
                $("#waybillNumId").attr("style", "");
                $("#waybillNoId").attr("placeholder", "请输入物流运单号");
            }
        }

        //物流单号查询
        function waybillNoQuery() {

            var billNo = $("#waybillNoId").val();
            if (billNo == "" || billNo == undefined) {
                alert("请输入物流运单号");
                return false;
            } else {
                var html = '<span class="token">' + billNo + '</span>';
                $("#waybillNoId").before(html);
                $("#waybillNoId").val("");
            }

            if (checkData()) {
                var tokenList = $(".token");
                var waybillNo = "";
                $.each(tokenList, function (x, y) {
                    waybillNo = $(".token").eq(x).text();
                });

                window.location = "{php echo $this->createMobileUrl('detail')}&orderId=" + waybillNo;
            }
        }

        function clearContent() {
            $(".token").remove();
            $("#waybillNoId").val("");
            initStyle();
        }


        //获取文本框光标所在的位置
        function getCursortPosition(ctrl) {
            var CaretPos = 0;   // IE Support
            if (document.selection) {
                ctrl.focus();
                var Sel = document.selection.createRange();
                Sel.moveStart('character', -ctrl.value.length);
                CaretPos = Sel.text.length;
            }
                // Firefox support
            else if (ctrl.selectionStart || ctrl.selectionStart == '0')
                CaretPos = ctrl.selectionStart;
            return (CaretPos);
        };

        //多个运单号查询时用逗号隔开
        function keyupFunctions(_this, event) {
            var susValue = tempWaybill.substring(0, portindex);
            if (event.keyCode == '8' || event.keyCode == '46') {
                if (susValue.length == "0") {
                    var list = $(".token");
                    if (list.length > 0) {
                        for (var i = list.length - 1; i >= 0; i--) {
                            $(".token").eq(i).remove();
                            break;
                        }
                    }
                }
            }
            getWaybillContent(_this);
            initStyle();
        }

        //文本框复制粘贴事件
        function onpasteFunction() {
            $('#waybillNoId').bind('paste', function (e) {
                var pastedText = undefined;
                if (window.clipboardData && window.clipboardData.getData) { // IE
                    pastedText = window.clipboardData.getData('Text');
                } else {
                    pastedText = e.originalEvent.clipboardData.getData('Text');//e.clipboardData.getData('text/plain');
                }
                var _this = {};
                _this.value = pastedText;
                getWaybillContent(_this);
                return false;
            });
            initStyle();
        }

        function getWaybillContent(_this) {
            var reg = /(\d{6,12})\,*/g;
            var temp_this = _this.value.replace(/\s|[^0-9]/g, "").replace(reg, '$1');

            var html = '<span class="token">' + temp_this + '</span>';
            $("#waybillNoId").before(html);
            $("#waybillNoId").val("");
        }

        //判断运单号是否重复
        function checkRepeat(list, value) {
            for (var j = 0; j < list.length; j++) {
                var str = $(".token").eq(j).text();
                if (value == str) {
                    return false;
                }
            }
            return true;
        }

        function checkData() {
            var list = $(".token");
            if (list.length < 1) {
                alert("请输入物流运单号");
                return false;
            }
            return true;
        }

    </script>
    <div class="msg-fadein" style="display: none;">系统繁忙，请稍后再试</div>



        </div>
    </div>
</body>


</html>